package data;

import org.newdawn.slick.opengl.Texture;

public class ResourcesManager {
	public static final int TEXTURE_INDEX_BLOCKS	= 0;
	public static final int TEXTURE_INDEX_PLATFORM	= 1;
	public static final int TEXTURE_INDEX_BALL		= 2;
	
	public static final String TEXTURE_BLOCKS_FILE		= "res/blocks.png";
	public static final String TEXTURE_PLATFORM_FILE	= "res/platform.png";
	public static final String TEXTURE_BALL_FILE		= "res/ball.png";
	
	private Texture[] textures;
	
	public ResourcesManager(){
		loadResources();
	}
	
	public Texture getTexture(int index){
		return textures[index];
	}
	
	public void loadResources(){
		textures = new Texture[3];
		
		//LOADING BLOCKS
		textures[TEXTURE_INDEX_BLOCKS] = TextureLoader.loadTexture(TEXTURE_BLOCKS_FILE);
		
		//LOADING PLATFORMS
		textures[TEXTURE_INDEX_PLATFORM] = TextureLoader.loadTexture(TEXTURE_PLATFORM_FILE);
		
		//LOADING BALLS
		textures[TEXTURE_INDEX_BALL] = TextureLoader.loadTexture(TEXTURE_BALL_FILE);
		
		System.out.println("[i] All resources have been loaded!");
	}
}
